package pe.edu.upc.dsd.ejemplojms;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

import org.apache.log4j.Logger;

public class MessageConsumer implements MessageListener{
	
	private Logger logger = Logger.getLogger(MessageConsumer.class);

	@Override
	public void onMessage(Message message) {
		if (message instanceof TextMessage) {
            final TextMessage textMessage = (TextMessage) message;
            try {
                    logger.debug("MessageConsumer:" + textMessage.getText());
            } catch (final JMSException e) {
                    e.printStackTrace();
            }
    }
		
	}
	
	

}
